package vashion.azeroth.core.manager.personal;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import vashion.azeroth.core.dao.BaseDao;
import vashion.azeroth.core.manager.impl.BaseManagerImpl;
import vashion.azeroth.core.personal.dao.PersonalAddressDao;
import vashion.azeroth.core.personal.pojo.PersonalAddress;

@Service
public class PersonalAddressManager extends BaseManagerImpl<PersonalAddress> {

	@Autowired
	private PersonalAddressDao addressDao;
	
	
	@Override
	public BaseDao<PersonalAddress> getDao() {
		
		return addressDao;
	}

	public int getMyAddrCount(long memberId) {
		
		return addressDao.getMyAddrCount(memberId);
		
	}

	public ArrayList<PersonalAddress> getAddrList(PersonalAddress address) {
		return addressDao.getAddrList(address);
	}

	public int checkMyAreaCode(PersonalAddress newAddress) {
		return addressDao.checkMyAreaCode(newAddress);
	}
	
	public int removeAddrByAddressId(PersonalAddress newAddress) {
		return addressDao.removeAddrByAddressId(newAddress);
	}

	public int getAddrById(PersonalAddress address) {
		return addressDao.getAddrById(address);
	}

	public PersonalAddress getMyDefAddr(long memberId) {
		return addressDao.getMyDefAddr(memberId);
	}
	
	public long getMyDefAddrId(Long memberId) {
		return addressDao.getMyDefAddrId(memberId);
	}

	public PersonalAddress queryDefaultAddress(
			PersonalAddress address) {
		return addressDao.queryDefaultAddress(address);
	}


}
